<template>
	<view>
		<!-- <QiunDataCharts type="pie" :opts="opts" :chartData="chartData" /> -->
	</view>
</template>
<script setup>
	// import QiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
	import {
		ref,
		onMounted
	} from 'vue'
	import {
		onLoad,
		onShow,
		onInit
	} from '@dcloudio/uni-app'
	//参数
	const props = defineProps({
		tableData: {
			type: Object,
			default: undefined
		}
	})
	onInit(()=>{

	})
	onMounted(()=>{
			console.log(props.tableData,"----------------------")
			let n0=0;//0日常事务
			let n1=0;//1项目事务
			let n2=0;//2=空闲
			let n3=0;//3=额外事务
			let n4=0;//4=请假
			let n5=0;//5=业务专属
			props.tableData.forEach((item)=>{
				item.personalPlanList.forEach((item2)=>{
					if(item2.type==0){
						n0++;
					}else if(item2.type==1){
						n1++;
					}else if(item2.type==3){
						n3++
					}else if(item2.type==4){
						n4++
					}else if(item2.type==5){
						n5++
					}
				})
			})
			n2=18*7-n0-n1-n3-n4-n5;
			//设置chartData
			chartData.value.series[0].data[0].value=n0;
			chartData.value.series[0].data[1].value=n1;
			chartData.value.series[0].data[2].value=n2;
			chartData.value.series[0].data[3].value=n3;
			chartData.value.series[0].data[4].value=n4;
			chartData.value.series[0].data[5].value=n5;
			console.log(chartData,"===========================")
	})
	//变量
	const opts = {
		color: ["#409EFF","#DAA520", "#00FF7F", "#CC66FF","#F70612","#CDD0D6", "#FC8452", "#9A60B4", "#ea7ccc"],
		padding: [5, 5, 5, 5],
		enableScroll: false,
		extra: {
			pie: {
				activeOpacity: 0.5,
				activeRadius: 10,
				offsetAngle: 0,
				labelWidth: 15,
				border: false,
				borderWidth: 3,
				borderColor: "#FFFFFF"
			}
		}
	}
	const chartData = ref({
		series: [{
			data: [{
				"name": "日常",
				"value": 0
			}, {
				"name": "项目",
				"value": 0
			}, {
				"name": "空闲",
				"value": 0
			}, {
				"name": "额外",
				"value": 0
			}, {
				"name": "请假",
				"value": 0
			}, {
				"name": "业务专属",
				"value": 0
			}]
		}]
	})
</script>

<style>
</style>